1. Field of the Invention
This invention is related to the field of computing systems, and more particularly, to the analysis and debug of digital systems.
2. Description of the Related Art
One of the more useful tools used in the analysis of computer systems is that of transaction tracing. Transaction tracing is the recording or observing of transactions which occur within a computer system in order to analyze the behavior of the computer system. Typically, transactions occurring on the computer system's memory or I/O bus are recorded for a period of time and subsequently analyzed in order to gain insight into the behavior of the system and the software executing on it.
FIG. 1 illustrates one embodiment of a system in which transaction tracing may be used. FIG. 1 shows a computer system 100 including processors 102A-102B, memories 104A-104B, I/O unit 106, and tracing unit 108 coupled to a bus 110. Elements referred to herein with a particular reference number followed by a letter will be collectively referred to by the reference number alone. For example, processors 102A-102B will be collectively referred to as processors 102. Whenever either processor 102A or 102B wants to access data contained in either memory 104, or perhaps in the other processor's cache, or wants to perform an I/O operation via the I/O unit 106, it issues a transaction on bus 110. The transaction on the bus 110 may then be observed by the tracing unit 108, which may record information pertinent to the transaction. Examples of pertinent information include the physical memory address used in the transaction, the data requested, or the time the transaction was issued. At a later time, the transactions recorded by the tracing unit can be retrieved and analyzed. It should be noted that while FIG. 1 illustrates tracing unit 108 as a standalone device, alternative embodiments may include tracing unit 108 as an integrated component of other devices or components.
Transaction tracing in non-bus based systems may be used as well. For example, a broadcast oriented network may utilize a transaction tracing unit to observe transaction data. Similarly, a system based on a switched interconnect could also incorporate a tracing unit. In the case of a switched interconnect, the tracing unit may be incorporated into the switch, or the switch may be programmed to send copies of all transactions to the tracing unit. Many different uses of transaction tracing are possible and are contemplated.
Transaction tracing may be used in a number of ways to assist in the debug and analysis of computing systems. First, tracing may be used to find faults in either the hardware or software of a system. For instance, if the I/O component of a system appears to be behaving incorrectly, it might be useful to trace the bus transactions corresponding to the incorrect behavior. By observing the relationship between the transactions appearing on the bus, and the behavior of the I/O unit, you may be able to isolate whether the I/O unit is behaving incorrectly or whether the software driving it is operating incorrectly.
Another way in which transaction tracing may be used is to analyze the performance of a system. For example, analysis of a trace may show that cache capacity misses were occurring and may be stopped by caches of a particular size. Analysis of a trace may reveal that data being used by different processors is located within the same cache line, leading to contention for that resource. In systems with non-uniform memory latency, analysis may determine what portion of data being used by a processor is coming from its local memory. Further, depending on a system's cache organization, analysis may reveal that two frequently accessed data items may map to the same cache location which may lead to unneeded bus transactions and reduced performance.
While transaction tracing can be extremely useful in system analysis and debug, it is not without its shortcomings. One problem with transaction tracing is that it observes and records the physical addresses of accessed data items. However, in most modern systems, applications deal with virtual addresses. Consequently, identifying the physical addresses of transactions may not be particularly useful to a developer trying to solve a problem with an application. Another problem with transaction tracing is that it has no visibility into which application or process is responsible for the transactions it is monitoring. Before an application developer can begin debugging an application, he must know which application at fault. Yet another problem with transaction tracing involves the vast quantity of data which may be generated by a system trace.
In view of the above described problems, a method and mechanism for facilitating system analysis and debug is desired.